home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / nt4.0 server / DRVLIB.NIC / AT1720 / OEMSETUP.INF < prev   
Encoding:
INI File  |  1996-07-31  |  46.9 KB  |  1,656 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADAM.INF
  4. ;
  5. ;       AT1700 Family network card and driver SETUP INF file.
  6. ;
  7. ; History:
  8. ;***********************************************************************
  9.  
  10. ;-----------------------------------------------------------------------
  11. ; OPTION TYPE
  12. ; -----------
  13. ; This identifies the Option type we are dealing with.  The different
  14. ; possible types are:
  15. ;
  16. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  17. ;
  18. ;  Types specific to networking:
  19. ;
  20. ; NetAdapter,        a netcard / adapter combination or just a netcard
  21. ; NetDriver,         just a netcard driver
  22. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  23. ; NetService,        an NT networking service
  24. ; NetWork,           a complete network ensemble.
  25. ; NetProvider        a complete network which supports NT MPR protocol
  26. ;-----------------------------------------------------------------------
  27.  
  28. [Identification]
  29.     OptionType = NetAdapter
  30.  
  31. ;-----------------------------------------------------------------------
  32. ; PlatformsSupported
  33. ; ------------------
  34. ; This identifies the platforms supported by the adapter card.
  35. ; Possible types are:
  36. ;
  37. ; ISA and EISA
  38. ;-----------------------------------------------------------------------
  39.  
  40. [PlatformsSupported]
  41.     ISA
  42.     EISA
  43.  
  44. ;-----------------------------------------------------------------------
  45. ; OPTION LIST
  46. ; -----------
  47. ; This section lists the OEM Option key names.  These keys are locale
  48. ; independent and used to represent the option in a locale independent
  49. ; manner.
  50. ;
  51. ;-----------------------------------------------------------------------
  52.  
  53. [Options]
  54.     AT1700
  55.  
  56. ;***********************************************************************
  57. ; CONSTANTS FOR USING DIALOGS
  58. ;***********************************************************************
  59.  
  60. [FileConstants]
  61.  
  62.  
  63. GenericInfVersion  = " v2.0"
  64. GenericAdapterName = " ATI AT1720 Ethernet Adapter"
  65. GenericDriverName  = "ATI AT1720 Ethernet Adapter Driver"
  66. GenericSysName     = "at1700.sys"
  67. GenericName        = "AT1700"
  68.  
  69.  
  70.  
  71. ;
  72. ;  File names, etc.
  73. ;
  74. UtilityInf      = "UTILITY.INF"
  75. ParamInf        = "NCPARAM.INF"
  76. subroutineinf   = "SUBROUTN.INF"
  77. SoftwareType    = "driver"
  78. Exit_Code       = 0
  79.  
  80. ;
  81. ; EventLog Message File
  82. ;
  83. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  84. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  85.  
  86. ; Product Info
  87. ;
  88. Manufacturer    = "Microsoft"
  89. ProductMajorVersion     = "3"
  90. ProductMinorVersion     = "1"
  91. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  92.  
  93. ;
  94. ; Software
  95. ;
  96. ProductSoftwareName     = "AT1700"
  97. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\"$(GenericSysName)
  98. NetRuleSoftwareType     = "at1700Sys ndisDriver at1700Driver"
  99.  
  100. NetRuleSoftwareUse      = $(SoftwareType)
  101. NetRuleSoftwareBindForm = """at1700Sys"" yes no container"
  102.  
  103. NetRuleSoftwareClass    = {"at1700Driver basic"}
  104. NetRuleSoftwareBindable = {"at1700Driver at1700Adapter non exclusive 100"}
  105. ;
  106. ; Hardware
  107. ;
  108. ProductHardwareName        = "AT1700"
  109. NetRuleHardwareType        = "at1700 at1700Adapter"
  110. NetRuleHardwareBindForm    = " yes yes container"
  111. NetRuleHardwareClass       = {"at1700Adapter basic"}
  112.  
  113.  
  114.  
  115. ;
  116. ; Registry Key
  117. ;
  118. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  119. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  120.  
  121.  
  122. [GeneralConstants]
  123. ;
  124. ;  Program flow control variables.
  125. ;
  126. from      = ""
  127. to        = ""
  128. ;
  129. ;  Return codes; Exit_Code is set to one of these
  130. ;
  131. ExitCodeOk     = 0
  132. ExitCodeCancel = 1
  133. ExitCodeFatal  = 2
  134.  
  135. KeyNull         = ""
  136. MAXIMUM_ALLOWED   = 33554432
  137. RegistryErrorIndex = NO_ERROR
  138. KeyProduct      = ""
  139. KeyParameters   = ""
  140.  
  141. TRUE            = 1
  142. FALSE           = 0
  143. NoTitle         = 0
  144.  
  145. ExitState   = "Active"
  146. OldVersionExisted = $(FALSE)
  147.  
  148. DriverPath      = $(!STF_NTPATH)\drivers
  149.  
  150. [date]
  151.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  152.     ; Minute, Second }
  153.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  154.  
  155.  
  156. ;---------------------------------------------------------------------------
  157. ; 1. Identify
  158. ;
  159. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  160. ;                as we are choosing currently.
  161. ;
  162. ; INPUT:         None
  163. ;
  164. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  165. ;                $($R1): Option Type (COMPUTER ...)
  166. ;                $($R2): Diskette description
  167. ;---------------------------------------------------------------------------
  168.  
  169. [Identify]
  170.     ;
  171.     ;
  172.     read-syms Identification
  173.  
  174.     set Status     = STATUS_SUCCESSFUL
  175.     set Identifier = $(OptionType)
  176.     set Media      = #("Source Media Descriptions", 1, 1)
  177.  
  178.     Return $(Status) $(Identifier) $(Media)
  179.  
  180. ;------------------------------------------------------------------------
  181. ; 2. ReturnOptions:
  182. ;
  183. ; DESCRIPTION:   To return the option list supported by this INF and the
  184. ;                localised text list representing the options.
  185. ;
  186. ;
  187. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  188. ;
  189. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  190. ;                                STATUS_NOLANGUAGE
  191. ;                                STATUS_FAILED
  192. ;                                STATUS_NOTSUPPORTED
  193. ;
  194. ;                $($R1): Option List
  195. ;                $($R2): Option Text List
  196. ;------------------------------------------------------------------------
  197.  
  198. [ReturnOptions]
  199.     ;
  200.     ;
  201.     set Status        = STATUS_FAILED
  202.     set OptionList     = {}
  203.     set OptionTextList = {}
  204.  
  205.     ;
  206.     ; Check if the language requested is supported
  207.     ;
  208.     set LanguageList = ^(LanguagesSupported, 1)
  209.     Ifcontains(i) $($0) in $(LanguageList)
  210.         ;
  211.         ; Check if the platforms requested is supported
  212.         ;
  213.         ifstr(i) $($1) == ""
  214.                         goto returnoptions
  215.         endif
  216.  
  217.         set PlatformList = ^(PlatformsSupported, 1)
  218.         Ifcontains(i) $($1) in $(PlatformList)
  219.                         goto returnoptions
  220.         else
  221.                         set Status = STATUS_NOTSUPPORTED
  222.                         goto finish_ReturnOptions
  223.         endif
  224.     else
  225.                 set Status = STATUS_NOLANGUAGE
  226.                 goto finish_ReturnOptions
  227.     endif
  228.  
  229.     ;
  230.     ; form a list of all the options and another of the text representing
  231.     ;
  232.  
  233. returnoptions = +
  234.     set OptionList     = ^(Options, 1)
  235.     set OptionTextList = ^(OptionsText$($0), 1)
  236.     set Status         = STATUS_SUCCESSFUL
  237.  
  238. finish_ReturnOptions = +
  239.     Return $(Status) $(OptionList) $(OptionTextList)
  240.  
  241. ;------------------------------------------------------------------------
  242. ;
  243. ; InstallOption:
  244. ;
  245. ;      This section is shelled to by main installation processing
  246. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  247. ;
  248. ;
  249. ; FUNCTION:  To copy files representing Options
  250. ;            To configure the installed option
  251. ;            To update the registry for the installed option
  252. ;
  253. ; INPUT:     $($0):  Language to use
  254. ;            $($1):  OptionID to install
  255. ;            $($2):  SourceDirectory
  256. ;            $($3):  AddCopy  (YES | NO)
  257. ;            $($4):  DoCopy   (YES | NO)
  258. ;            $($5):  DoConfig (YES | NO)
  259. ;
  260. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  261. ;                            STATUS_NOLANGUAGE |
  262. ;                            STATUS_USERCANCEL |
  263. ;                            STATUS_FAILED
  264. ;
  265. ;------------------------------------------------------------------------
  266. [InstallOption]
  267.     ;
  268.     ; Set default values for
  269.     ;
  270.     set Status   = STATUS_FAILED
  271.     ;
  272.     ; extract parameters
  273.     ;
  274.     set Option   = $($1)
  275.     set SrcDir   = $($2)
  276.     set AddCopy  = $($3)
  277.     set DoCopy   = $($4)
  278.     set DoConfig = $($5)
  279.  
  280.     ;
  281.     ; Check if the language requested is supported
  282.     ;
  283.     set LanguageList = ^(LanguagesSupported, 1)
  284.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  285.         Return STATUS_NOLANGUAGE
  286.     endif
  287.  
  288.     set-subst LF = "\n"
  289.  
  290.     read-syms GeneralConstants
  291.     read-syms FileConstants
  292.  
  293.     read-syms DialogConstants$(!STF_LANGUAGE)
  294.     ifstr(i) $(!NTN_Origination) == "NCPA"
  295.         set Continue = $(OK)
  296.     endif
  297.     read-syms FileConstants$(!STF_LANGUAGE)
  298.  
  299.     detect date
  300.  
  301.     set-title  $(FunctionTitle)
  302.  
  303.     set to   = Begin
  304.     set from = Begin
  305. ;
  306. ;  Assume all is well.
  307. ;
  308.     set CommonStatus = STATUS_SUCCESSFUL
  309.  
  310.     EndWait
  311.  
  312. ;
  313. ;   Set up the operation-mode-based variables and gaily welcome
  314. ;   the user.  If the "install mode" variable is improperly set,
  315. ;   assume this is a new installation.
  316. ;
  317.  
  318. Begin = +
  319.     Set ActivateDetection = FALSE
  320.  
  321.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  322.         set StartLabel = removeadapter
  323.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  324.         set StartLabel = UpgradeSoftware
  325.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  326.         set StartLabel = bindingadapter
  327.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  328. ;        set ActivateDetection = TRUE
  329.         set StartLabel = configureadapter
  330.         ;
  331.         ;   You cannot config the software component
  332.         ;
  333.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  334.             Debug-Output "Cannot configure the AT1700 driver software."
  335.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  336.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  337.                 Debug-Output "ShellCode error: cannot get an error string."
  338.                 goto ShellCodeError
  339.             endif
  340.             set Error = $($R0)
  341.             set from = end
  342.             set to = end
  343.             goto nonfatalinfo
  344.         endif
  345.     else
  346. ;        set ActivateDetection = TRUE
  347.         set StartLabel = installadapter
  348.         set OEM_ABANDON_OPTIONS = {}
  349.         set OEM_ABANDON_SOFTWARE = FALSE
  350.         set OEM_ABANDON_ON = TRUE
  351.     endif
  352.  
  353.  
  354.  
  355.     ;  set the default values
  356.  
  357.     ; IRQ Level = 5
  358.     set IRQValue = *($(IRQList), 3)
  359.  
  360.     ; IOBase Address = 0x300
  361.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  362.  
  363.     ; DMAChannel = 5
  364.     set DMAChannelValue = *($(DMAChannelList), 2)
  365.     
  366.     set RadioIn  = {7} 
  367.     set BusScanValue = "ALL" 
  368.     set LED0Value = *($(LEDList), 1)
  369.     set LED1Value = *($(LEDList), 1)
  370.     set LED2Value = *($(LEDList), 1)
  371.     set LED3Value = *($(LEDList), 1)
  372.     set TPValue = 1
  373.     set FullDuplexValue = *($(FullDuplexList), 1)
  374.     set MediaTypeValue = *($(MediaTypeList), 2)
  375.  
  376.     Set from = $(fatal)
  377.     Set to = $(fatal)
  378.     Goto $(StartLabel)
  379.  
  380. ;-----------------------------------------------
  381. ; Installation Section
  382. ;-----------------------------------------------
  383.  
  384. installadapter = +
  385. ;
  386. ;   First, check whether the same version of the software exists
  387. ;
  388.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  389.  
  390.     Ifstr $(KeyProduct) != $(KeyNull)
  391.         ;
  392.         ; Same version already existed in the local machine
  393.         ; Popup the dialog and ask the user whether he wants to continue
  394.         ;
  395.         CloseRegKey $(KeyProduct)
  396.  
  397.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  398.            ;
  399.            ; Cannot Install the same software again
  400.            ;
  401.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  402.                $(ProductVersion)
  403.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  404.                Debug-Output "ShellCode error: cannot get an error string."
  405.                goto ShellCodeError
  406.            endif
  407.  
  408.            goto end
  409.         else
  410.            ;
  411.            ; Add a new adapter card?
  412.            ;
  413.            Shell $(UtilityInf), CardExistedDlg
  414.  
  415.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  416.                Debug-Output "ShellCode error: cannot get an error string."
  417.                goto ShellCodeError
  418.            endif
  419.  
  420.            ifstr(i) $($R1) != "OK"
  421.                goto end
  422.            endif
  423.            set OldVersionExisted = $(TRUE)
  424.         endif
  425.     endif
  426.  
  427.     ; If we're installing a second time, don't re-copy the help file
  428.     ; !!!
  429.     ifint $(OldVersionExisted) == $(FALSE)
  430.     ifstr(i) $(!NTN_InstallMode) == "install"
  431.        Ifstr(i) $(DoCopy) == "YES"
  432.         Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) NO
  433.           
  434.         Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  435.             Goto ShellCodeError
  436.         Else-Ifstr(i) $($R0) == STATUS_FAILED
  437.             Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  438.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  439.             goto ShellCodeError
  440.             endif
  441.             set Error = $($R0)
  442.             Goto fatal
  443.         Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  444.             Goto successful
  445.         Endif
  446.     
  447.         Set SrcDir = $($R1)
  448.         endif
  449.  
  450.         install "Install-Helpfile"
  451.     endif
  452.     endif
  453.  
  454.     SetHelpFile "at1700.hlp" 1 11
  455.  
  456. ;
  457. ;  dll load addition
  458. ;
  459.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  460.  
  461.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  462.         Goto ShellCodeError
  463.     Else-Ifstr(i) $($R0) == STATUS_FAILED
  464.         Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  465.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  466.             goto ShellCodeError
  467.         endif
  468.         set Error = $($R0)
  469.         Goto fatal
  470.     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  471.         Goto successful
  472.     Endif
  473.  
  474.     Set SrcDir = $($R1)
  475.  
  476.     install "Install-Dll"
  477.  
  478.     goto adaptersetup
  479.  
  480. ;-----------------------------------------------
  481. ; Configuration Section
  482. ;-----------------------------------------------
  483. ;
  484. ;   Get the current values of all the parameters
  485. ;
  486. configureadapter = +
  487.  
  488.     SetHelpFile "at1700.hlp" 1 11
  489.  
  490.     Ifstr $(KeyProduct) == $(KeyNull)
  491.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  492.         Ifstr $(KeyProduct) == $(KeyNull)
  493.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  494.             Debug-Output "Cannot find component product key"
  495.             goto fatalregistry
  496.         Endif
  497.     Endif
  498.  
  499.     ;
  500.     ; Get the other parameters;  they're attached to the service parameters key
  501.     ;
  502.     Debug-Output "INF: Shelling to FindService"
  503.     Shell $(UtilityInf) FindService, $(KeyProduct)
  504.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  505.         Debug-Output "INF: FindService shell failure"
  506.         Goto ShellCodeError
  507.     Endif
  508.     Ifstr(i) $($R0) != NO_ERROR
  509.         Debug-Output "INF: FindService Shell error: "$($R0)
  510.         Goto fatalregistry
  511.     endif
  512.  
  513.     Set KeyParameters = $($R2)
  514.  
  515.     ;
  516.     ;  We don't need the services key, so close it.
  517.     ;
  518.     CloseRegKey $($R1)
  519.  
  520.     Ifstr $(KeyParameters) == $(KeyNull)
  521.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  522.         Debug-Output "Cannot find component service"
  523.         goto fatalregistry
  524.     endif
  525.  
  526.     set OldVersionExisted = $(TRUE)
  527.  
  528.     set ValueName = ""
  529.     set ValueData = ""
  530.     set ValueStr  = ""
  531.     set ValueList = {}
  532.  
  533.     ;
  534.     ; Get the old values
  535.     ;
  536.     EnumRegValue $(KeyParameters) ValueList
  537.  
  538.     ForListDo $(ValueList)
  539.         set ValueItem = $($)
  540.         set ValueName = *($(ValueItem),1)
  541.         set ValueData = *($(ValueItem),4)
  542.         ifstr(i) $(ValueName) == "SLOT"
  543.             set IOBaseAddrIndex = $(ValueData)
  544.         endif
  545.  
  546.     EndForListDo
  547.  
  548.                  
  549.     Ifint $(TPValue) == 0
  550.         Set CheckItemsIn = {"OFF"}
  551.     Else
  552.         Set CheckItemsIn = {"ON"}
  553.     Endif                
  554.     
  555.     ; set the Radio Buttons depending on the bustype in the reg.
  556.     
  557.     Ifstr $(BusScanValue) == "PCI"
  558.         Set RadioIn = {1}
  559.     Else-Ifstr $(BusScanValue) == "PNP"
  560.         Set RadioIn = {2}
  561.     Else-Ifstr $(BusScanValue) == "VESA"
  562.         Set RadioIn = {3}
  563.     Else-Ifstr $(BusScanValue) == "ISA"
  564.         Set RadioIn = {4}
  565.     Else-Ifstr $(BusScanValue) == "PCI1"
  566.         Set RadioIn = {5}
  567.     Else-Ifstr $(BusScanValue) == "PCI2"
  568.         Set RadioIn = {6}
  569.     Else-Ifstr $(BusScanValue) == "ALL"
  570.         Set RadioIn = {7}
  571.     Else-Ifstr $(BusScanValue) == ""
  572.         Set RadioIn = {7}
  573.     Endif
  574.  
  575.     Debug-Output $(InfName)" TP is "$(TPValue)
  576.                             
  577.  
  578.     set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  579.     ifstr(i) $(IRQValue) == ""
  580.         set IRQValue = *($(IRQList), 3)
  581.     endif
  582.  
  583.     Debug-Output $(InfName)" IRQ_Level is "$(IRQValue)
  584.  
  585.     set DMAChannelValue = *($(DMAChannelList), ~($(DMAChannelValues),$(DMAChannelIndex)))
  586.     ifstr(i) $(DMAChannelValue) == ""
  587.         set DMAChannelValue = *($(DMAChannelList), 2)
  588.     endif
  589.  
  590.     Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  591.  
  592.     set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  593.  
  594.     ifstr(i) $(IOBaseAddrValue) == ""
  595.         set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  596.     endif
  597.  
  598.     Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  599.  
  600.     set LED0Value = *($(LEDList), ~($(LEDValues),$(LED0Index)))
  601.  
  602.     ifstr(i) $(LED0Value) == ""
  603.         set LED0Value = *($(LEDList), 1)
  604.     endif
  605.  
  606.     Debug-Output $(InfName)" LED0 is "$(LED0Value)
  607.  
  608.     set LED1Value = *($(LEDList), ~($(LEDValues),$(LED1Index)))
  609.  
  610.     ifstr(i) $(LED1Value) == ""
  611.         set LED1Value = *($(LEDList), 1)
  612.     endif
  613.  
  614.     Debug-Output $(InfName)" LED1 is "$(LED1Value)
  615.  
  616.     set LED2Value = *($(LEDList), ~($(LEDValues),$(LED2Index)))
  617.  
  618.     ifstr(i) $(LED2Value) == ""
  619.         set LED2Value = *($(LEDList), 1)
  620.     endif
  621.  
  622.     Debug-Output $(InfName)" LED2 is "$(LED0Value)
  623.  
  624.     set LED3Value = *($(LEDList), ~($(LEDValues),$(LED3Index)))
  625.  
  626.     ifstr(i) $(LED3Value) == ""
  627.         set LED3Value = *($(LEDList), 1)
  628.     endif
  629.  
  630.     Debug-Output $(InfName)" LED3 is "$(LED3Value)
  631.  
  632.     set FullDuplexValue = *($(FullDuplexList), ~($(FullDuplexValues),$(FullDuplexIndex)))
  633.  
  634.     ifstr(i) $(FullDuplexValue) == ""
  635.         set FullDuplexValue = *($(FullDuplexList), 1)
  636.     endif
  637.  
  638.     Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  639.  
  640.  
  641.     set MediaTypeValue = *($(MediaTypeList), ~($(MediaTypeValues),$(MediaTypeIndex)))
  642.  
  643.     ifstr(i) $(MediaTypeValue) == ""
  644.         set MediaTypeValue = *($(MediaTypeList), 2)
  645.     endif
  646.  
  647.     Debug-Output $(InfName)" Media Type is "$(MediaTypeValue)
  648.  
  649.  
  650.     ;  Save the settings as they were read from the Registry.
  651.  
  652. ;    Shell $(ParamInf) Param_SaveValues
  653. ;    Set CurrParamSettings = $($R0)
  654. ;
  655. ;   Put up the adapter configuration dialog if necessary.
  656. ;
  657. ;   Note that $(CurrParamSettings) has the old known parameter values.
  658. ;
  659. adaptersetup = +
  660.  
  661. ;    Shell "" DebugConfiguration "before displaying dialog"
  662.  
  663.     Set from = adapteroptions
  664.  
  665.  
  666. adapteroptions = +
  667.  
  668.  
  669.     LoadLibrary "Disk 1" .\$(DialogDllName) hLib
  670.  
  671.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  672.  
  673.     Debug-Output $(InfName)" Bus is "$(BusScanValue)
  674.     Debug-Output $(InfName)" TP is "$(TPValue)
  675.     Debug-Output $(InfName)" LED0 is "$(LED0Value)
  676.     Debug-Output $(InfName)" LED1 is "$(LED1Value)
  677.     Debug-Output $(InfName)" LED2 is "$(LED2Value)
  678.     Debug-Output $(InfName)" LED3 is "$(LED3Value)
  679.     Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  680.     Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  681.     Debug-Output $(InfName)" Full Duplex is "$(FullDuplexValue)
  682.     Debug-Output $(InfName)" Media Type is "$(MediaTypeValue)
  683.  
  684.  
  685.     ui start "InputDlg"  $(hLib)
  686.  
  687.     set ExitButton      = $(ButtonPressed)
  688.  
  689.     Debug-Output " ButtonPressed "$(ButtonPressed)
  690.  
  691.  
  692.     FreeLibrary $(hLib)
  693.  
  694.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  695.                 set IOBaseAddrIndex = $(Combo1Out)
  696.                 set IRQValueIndex = $(Combo2Out)
  697.                 set DMAChannelIndex = $(Combo3Out)
  698. ;                set FullDuplexIndex = $(Combo4Out)
  699.                 set MediaTypeIndex = $(Combo4Out)
  700.                 set LED0Index = $(Combo5Out)
  701.                 set LED1Index = $(Combo6Out)
  702.                 set LED2Index = $(Combo7Out)
  703.                 set LED3Index = $(Combo8Out)
  704.                 set ExitButton = $(ButtonPressed)
  705.  
  706.                 set BusIndex = *($(RadioOut),1)
  707.  
  708.                 Debug-Output $(InfName)" Busindex is "$(BusIndex)
  709.  
  710.                 Ifint $(BusIndex) == 1
  711.                     Set BusScanValue = "PCI"
  712.                 else-Ifint $(BusIndex) == 2
  713.                     Set BusScanValue = "PNP"
  714.                 else-Ifint $(BusIndex) == 3
  715.                     Set BusScanValue = "VESA"
  716.                 else-Ifint $(BusIndex) == 4
  717.                     Set BusScanValue = "ISA"
  718.                 else-Ifint $(BusIndex) == 5
  719.                     Set BusScanValue = "PCI1"
  720.                 else-IFint $(BusIndex) == 6
  721.                     Set BusScanValue = "PCI2"
  722.                 else-Ifint $(BusIndex) ==  7
  723.                     Set BusScanValue = "ALL"
  724.                 Endif
  725.  
  726.                                     
  727.         Set Chk = *($(CheckItemsOut), 1)     
  728.         Ifstr(i) $(Chk) == "ON"
  729.             Set TPValue = 1
  730.         Else
  731.             Set TPValue = 0
  732.         Endif
  733.  
  734.                 ui pop 1
  735. ;               goto nextstep
  736.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  737.                 set CommonStatus = STATUS_USERCANCEL
  738.                 Debug-Output "Action: exit. Bye."
  739.                 ui pop 1
  740.                 goto end
  741.     else
  742.                 ;
  743.                 ; Unknow command
  744.                 ;
  745.                 ui pop 1
  746.  
  747.  
  748.                 Debug-Output "Action: unknown. Bye."
  749.                 goto end
  750.     endif
  751.  
  752.  
  753.     Debug-Output " Combo list out "$(ComboListItemsOut)
  754.  
  755.  
  756. ;
  757. ;   If installing, go create the necessary keys;
  758. ;   if configuring, they're already open.
  759. ;
  760. skipoptions =+
  761.  
  762.     ifint $(OldVersionExisted) == $(TRUE)                               
  763.         ifstr(i) $(!NTN_InstallMode) == configure
  764.             goto writeparameters
  765.         endif                                                                
  766.     endif
  767.     StartWait
  768.     ;
  769.     ; Add Software Component
  770.     ;
  771.     ifint $(OldVersionExisted) == $(FALSE)
  772.  
  773.         ifstr(i) $(!NTN_InstallMode) == "install"
  774.            Ifstr(i) $(DoCopy) == "YES"
  775.  
  776.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  777.  
  778.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  779.                   Goto ShellCodeError
  780.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  781.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  782.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  783.                       goto ShellCodeError
  784.                   endif
  785.                   set Error = $($R0)
  786.                   Goto fatal
  787.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  788.                   Goto successful
  789.               Endif
  790.  
  791.               Set SrcDir = $($R1)
  792.  
  793.            Endif
  794.  
  795.            install "Install-Option"
  796.  
  797.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  798.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  799.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  800.                   goto ShellCodeError
  801.               endif
  802.               set Error = $($R0)
  803.               goto fatal
  804.            endif
  805.         endif
  806.  
  807.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  808.             $(ProductSoftwareName), +
  809.             $(ProductSoftwareName), +
  810.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  811.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  812.             $(NetEventDLL)
  813.  
  814.         Set OEM_ABANDON_SOFTWARE = TRUE
  815.  
  816.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  817.             Debug-Output "ShellCode error"
  818.             goto ShellCodeError
  819.         endif
  820.         ;
  821.         ;   At this point:
  822.         ;     $R1 contains the product version key handle;
  823.         ;     $R2 contains the NetRules subkey handle;
  824.         ;     $R3 contains the new Services key handle; and
  825.         ;     $R4 contains the Parameters key
  826.         ;     $R5 contains the Linkage Key
  827.         ;
  828.         set RegistryErrorIndex = $($R0)
  829.         set KeyProduct      = $($R1)
  830.         Set SoftNetRulesKey = $($R2)
  831.         CloseRegKey $($R3)
  832.         CloseRegKey $($R4)
  833.         CloseRegKey $($R5)
  834.  
  835.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  836.             EndWait
  837.             Debug-Output "Registry error: add software components"
  838.             CloseRegKey $(KeyProduct)
  839.             CloseRegKey $(SoftNetRulesKey)
  840.             goto fatalregistry
  841.         endif
  842.  
  843.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  844.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  845.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  846.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  847.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  848.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  849.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  850.  
  851.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  852.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  853.             Debug-Output "ShellCode error."
  854.             goto ShellCodeError
  855.         endif
  856.  
  857.         set RegistryErrorIndex = $($R0)
  858.  
  859.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  860.             EndWait
  861.             Debug-Output "Registry error: add value list."
  862.             CloseRegKey $(KeyProduct)
  863.             CloseRegKey $(SoftNetRulesKey)
  864.             goto fatalregistry
  865.         endif
  866.  
  867.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  868.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  869.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  870.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  871.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  872.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  873.  
  874.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  875.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  876.             Debug-Output "ShellCode error."
  877.             goto ShellCodeError
  878.         endif
  879.  
  880.         set RegistryErrorIndex = $($R0)
  881.  
  882.         CloseRegKey $(KeyProduct)
  883.         CloseRegKey $(SoftNetRulesKey)
  884.  
  885.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  886.             EndWait
  887.             Debug-Output "Resgitry error: add value list."
  888.             goto fatalregistry
  889.         endif
  890.     endif
  891. ;
  892. ;   Create the HARDWARE\Netcard region and its corresponding service
  893. ;
  894.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  895.  
  896.     ifint $($R4) != -1
  897.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  898.     endif
  899.  
  900.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  901.         Debug-Output "Cannot add hardware component"
  902.         goto ShellCodeError
  903.     endif
  904.  
  905.     set RegistryErrorIndex = $($R0)
  906.  
  907.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  908.         EndWait
  909.         Debug-Output "Registry error: add hardware component"
  910.         CloseRegKey $($R1)
  911.         CloseRegKey $($R2)
  912.         CloseRegKey $($R3)
  913.         goto fatalregistry
  914.     endif
  915.  
  916. ;
  917. ;   At this point:
  918. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  919. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  920. ;     $R3  Registry key handle for <service>\Parameters key
  921. ;     $R4  Adapter number assigned to adapter
  922. ;     $R5  Service name generated by combining svc name with adapter number
  923. ;
  924.     set KeyParameters = $($R3)
  925.     set KeyAdapterRules = $($R2)
  926.     set AdapterNumber = $($R4)
  927.  
  928.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  929.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  930.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  931.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  932.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  933.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  934.  
  935.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  936.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  937.         Debug-Output "ShellCode error"
  938.         goto ShellCodeError
  939.     endif
  940.  
  941.     CloseRegKey $($R1)
  942.  
  943.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  944.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  945.  
  946.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  947.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  948.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  949.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  950.  
  951.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  952.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  953.         Debug-Output "ShellCode error."
  954.         goto ShellCodeError
  955.     endif
  956.  
  957.     set RegistryErrorIndex = $($R0)
  958.  
  959.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  960.         EndWait
  961.         Debug-Output "Resgitry error: add value list."
  962.         CloseRegKey $(KeyParameters)
  963.         CloseRegKey $(KeyAdapterRules)
  964.         goto fatalregistry
  965.     endif
  966.  
  967.     CloseRegKey $(KeyAdapterRules)
  968.  
  969.     goto writeparameters
  970. ;
  971. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  972. ;
  973. writeparameters = +
  974.     Shell $(UtilityInf), GetBusTypeNum
  975.     set BusTypeNum = $($R1)
  976. ; Testing the BusNum. We are coding it to 0
  977.     set BusNumberValue = 0 ;
  978. ; End of BusNumber
  979.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  980.         Debug-Output "ShellCode error."
  981.         goto ShellCodeError
  982.     endif
  983.  
  984.     set DMAChannelValue = *($(DMAChannelValues), ~($(DMAChannelList),$(DMAChannelIndex)))
  985.  
  986.     set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueIndex)))
  987.  
  988.     set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
  989.  
  990.     set LED0Value = *($(LEDValues), ~($(LEDList),$(LED0Index)))
  991.     set LED1Value = *($(LEDValues), ~($(LEDList),$(LED1Index)))
  992.     set LED2Value = *($(LEDValues), ~($(LEDList),$(LED2Index)))
  993.     set LED3Value = *($(LEDValues), ~($(LEDList),$(LED3Index)))
  994.     set FullDuplexValue = *($(FullDuplexValues), ~($(FullDuplexList),$(FullDuplexIndex)))
  995.     set MediaTypeValue = *($(MediaTypeValues), ~($(MediaTypeList),$(MediaTypeIndex)))
  996.  
  997.   ; Ifint $(TPValue) != 0
  998.     set NewValueList = {{BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  999.                         {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  1000.                         {SLOT,  $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  1001.                         {BusNumber,  $(NoTitle),$(!REG_VT_DWORD),$(BusNumberValue)}}
  1002.  
  1003.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  1004.  
  1005.     CloseRegKey $(KeyParameters)
  1006.  
  1007.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1008.         Debug-Output "ShellCode error."
  1009.         goto ShellCodeError
  1010.     endif
  1011.  
  1012.     set RegistryErrorIndex = $($R0)
  1013.  
  1014.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1015.         Debug-Output "Registry error: Add value list"
  1016.         goto fatalregistry
  1017.     endif
  1018.  
  1019.     EndWait
  1020.  
  1021.     goto successful
  1022.  
  1023. ;-----------------------------------------------
  1024. ; Binding section
  1025. ;-----------------------------------------------
  1026. bindingadapter =+
  1027.     set Error = "Binding: Sorry, not yet implemented."
  1028.     goto fatal
  1029.  
  1030. ;-----------------------------------------------
  1031. ; Removeadapter section
  1032. ;-----------------------------------------------
  1033.  
  1034. removeadapter = +
  1035.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1036.         ; Remove Software Component
  1037.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1038.             $(ProductSoftwareName)
  1039.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1040.             Debug-Output "ShellCode error"
  1041.             goto ShellCodeError
  1042.         endif
  1043.  
  1044.         set RegistryErrorIndex = $($R0)
  1045.  
  1046.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1047.             goto fatalregistry
  1048.         endif
  1049.     else
  1050.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1051.             $(ProductSoftwareName), $(!NTN_RegBase)
  1052.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1053.             Debug-Output "ShellCode error"
  1054.             goto ShellCodeError
  1055.         endif
  1056.  
  1057.         set RegistryErrorIndex = $($R0)
  1058.  
  1059.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1060.             goto fatalregistry
  1061.         endif
  1062.     endif
  1063.  
  1064.     goto end
  1065.  
  1066. ;-----------------------------------------------
  1067. ; Upgrade Software section
  1068. ;-----------------------------------------------
  1069.  
  1070. UpgradeSoftware = +
  1071.     ;
  1072.     ; First determine whether we want to do upgrade or update for software
  1073.     ; or hardware component. Then we will determine whether the Mode is
  1074.     ; update or upgrade.
  1075.     ;
  1076.     ; If the same version of the product existed in the registry, we do
  1077.     ; update. Otherwise, we will do a upgrade
  1078.     ;
  1079.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  1080.         ; Upgrade software component
  1081.         ;
  1082.         ; see whether the same version exist or not
  1083.         ;
  1084.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  1085.  
  1086.         Ifstr $(KeyProduct) != $(KeyNull)
  1087.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  1088.             set Version = *($(VersionInfo), 4)
  1089.  
  1090.             ;
  1091.             ; Update the binaries
  1092.             ;
  1093.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  1094.  
  1095.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1096.                 Debug-Output "ShellCode error"
  1097.                 goto ShellCodeError
  1098.             endif
  1099.  
  1100.             set !UG_Filename = $($R0)
  1101.  
  1102.             ifstr(i) $(!UG_Filename) != ""
  1103.                 install "Install-Update"
  1104.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  1105.                     goto fatal
  1106.                 endif
  1107.             endif
  1108.  
  1109.             ; Upgrade the version number
  1110.             ;
  1111.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1112.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1113.  
  1114.             ;
  1115.             ; do nothing for update
  1116.             ;
  1117.             ifint $(Version) != $(ProductVersion)
  1118.                ;
  1119.                ; If the major version number is not the same,
  1120.                ; it is major upgrade. So let Upgrade the product
  1121.                ;
  1122.                ;
  1123.                ; make other upgrade change if necessary
  1124.                ;
  1125.             endif
  1126.             CloseRegKey $(KeyProduct)
  1127.         else
  1128.             ;
  1129.             ; Cannot Open software key, goto ERROR
  1130.             ;
  1131.             goto fatalregistry
  1132.         endif
  1133.     else
  1134.         ;
  1135.         ; upgrade/update hardware component
  1136.         ; There is no different between upgrade and update for hardware
  1137.         ; component
  1138.         ;
  1139.         ; 1. Get the Service Name
  1140.         ; 2. Change the NetRule section if necessary
  1141.         ;
  1142.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1143.               $(MAXIMUM_ALLOWED) NetworkCardKey
  1144.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1145.             ;
  1146.             ; Get Service name
  1147.             ;
  1148.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1149.             set ServiceName = *($(ServiceNameInfo), 4)
  1150.  
  1151.             ;
  1152.             ; Change the NetRule if necessary
  1153.             ;
  1154.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1155.                 $(MAXIMUM_ALLOWED) NetRuleKey
  1156.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1157.                 ;
  1158.                 ; Make the change....
  1159.                 ;
  1160.             else
  1161.                 ;
  1162.                 ; Error, cannot open net rules key
  1163.                 ;
  1164.                 goto fatalregistry
  1165.             endif
  1166.  
  1167.             CloseRegKey $(NetRules)
  1168.             CloseRegKey $(NetworkCardKey)
  1169.         else
  1170.             ;
  1171.             ; Error, cannot open network card key
  1172.             ;
  1173.             goto fatalregistry
  1174.         endif
  1175.         ;
  1176.         ; 3. Change the service section of the hardware. i.e.,
  1177.         ;    ParameterName change, value change, etc.
  1178.         ;
  1179.         OpenRegKey $(!REG_H_LOCAL) "" +
  1180.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  1181.               $(MAXIMUM_ALLOWED) ServiceKey
  1182.  
  1183.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  1184.             ;
  1185.             ; Get the ServiceKey to change the Start value
  1186.             ; or Type value. Or open Parameters key to
  1187.             ; change the hardware parameters if necessary.
  1188.             ;
  1189.             CloseRegKey $(ServiceKey)
  1190.         else
  1191.             ;
  1192.             ; Error, cannot open network card key
  1193.             ;
  1194.             goto fatalregistry
  1195.         endif
  1196.     endif
  1197.  
  1198.     goto end
  1199.     ;
  1200.     ; End of Upgrade Software
  1201.     ;
  1202.  
  1203. ;
  1204. ;  Escape hatches
  1205. ;
  1206. successful = +
  1207.     goto end
  1208.  
  1209. abandon = +
  1210.     ForListDo $(OEM_ABANDON_OPTIONS)
  1211.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1212.             $(ProductSoftwareName), $($)
  1213.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1214.             Debug-Output "ShellCode error"
  1215.             goto ShellCodeError
  1216.         endif
  1217.  
  1218.         set RegistryErrorIndex = $($R0)
  1219.  
  1220.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1221.             goto fatalregistry
  1222.         endif
  1223.     EndForListDo
  1224.  
  1225.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1226.         ; Remove Software Component
  1227.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1228.             $(ProductSoftwareName), FALSE
  1229.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1230.             Debug-Output "ShellCode error"
  1231.             goto ShellCodeError
  1232.         endif
  1233.  
  1234.         set RegistryErrorIndex = $($R0)
  1235.  
  1236.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1237.             goto fatalregistry
  1238.         endif
  1239.     endif
  1240.  
  1241.     goto end
  1242.  
  1243. ;
  1244. ; warning display
  1245. ;
  1246. warning = +
  1247.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1248.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1249.         goto ShellCodeError
  1250.     endif
  1251.     ifstr(i) $($R1) == "OK"
  1252.         goto $(to)
  1253.     else-ifstr(i) $($R1) == "CANCEL"
  1254.         goto $(from)
  1255.     else
  1256.         goto "end"
  1257.     endif
  1258. ;
  1259. ; non fatal error display
  1260. ;
  1261. nonfatalinfo = +
  1262.     Set Severity = STATUS
  1263.     Set CommonStatus = STATUS_USERCANCEL
  1264.     goto nonfatalmsg
  1265. nonfatal = +
  1266.     Set Severity = NONFATAL
  1267.     goto nonfatalmsg
  1268. nonfatalmsg = +
  1269.     ifstr(i) $(Error) == ""
  1270.         Set Severity = NONFATAL
  1271.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1272.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1273.             goto ShellCodeError
  1274.         endif
  1275.         set Error = $($R0)
  1276.     endif
  1277.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1278.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1279.         goto ShellCodeError
  1280.     endif
  1281.     ifstr(i) $($R1) == "OK"
  1282.         goto $(from)
  1283.     else
  1284.         goto "end"
  1285.     endif
  1286.  
  1287. ;
  1288. ;  Registry is broken
  1289. ;
  1290. fatalregistry = +
  1291.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1292.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1293.         goto ShellCodeError
  1294.     endif
  1295.     set Error = $($R0)
  1296.     goto fatal
  1297. ;
  1298. ;  Netcard detection failure
  1299. ;
  1300. fataldetect = +
  1301.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1302.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1303.         Debug-Output "ShellCode error: cannot get an error string."
  1304.         goto ShellCodeError
  1305.     endif
  1306.     set Error = $($R0)
  1307.     Goto fatal
  1308. ;
  1309. ; fatal error display
  1310. ;
  1311. fatal = +
  1312.     ifstr(i) $(Error) == ""
  1313.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1314.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1315.             goto ShellCodeError
  1316.         endif
  1317.         set Error = $($R0)
  1318.     endif
  1319.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1320.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1321.         goto ShellCodeError
  1322.     endif
  1323.  
  1324.     goto setfailed
  1325.  
  1326. ;
  1327. ;  Shelling error
  1328. ;
  1329. ShellCodeError = +
  1330.     set DlgType      = "MessageBox"
  1331.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1332.     set STF_MB_TEXT  = $(ShellCodeErrorText) 
  1333.     set STF_MB_TYPE  = 1
  1334.     set STF_MB_ICON  = 3
  1335.     set STF_MB_DEF   = 1
  1336.     ui start "Error Message"
  1337.     goto setfailed
  1338.  
  1339. setfailed = +
  1340.     set CommonStatus = STATUS_FAILED
  1341.     ;
  1342.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1343.     ;
  1344.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1345.         set OEM_ABANDON_ON = FALSE
  1346.         goto abandon
  1347.     endif
  1348.     goto end
  1349.  
  1350. end = +
  1351.     goto term
  1352.  
  1353. term = +
  1354.  
  1355.     Return $(CommonStatus)
  1356.  
  1357. [DebugConfiguration]
  1358.  
  1359.     Set InfName = "OEMNADAM.INF"
  1360.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1361.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1362.     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1363.     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1364.     Debug-Output $(InfName)" MemBaseAddrDec is "$(!p:MemBaseAddrDec)
  1365.     Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  1366.  
  1367.     return
  1368.  
  1369.  
  1370. ;***************************************************************
  1371. ;  INSTALL SECTIONS
  1372. ;***************************************************************
  1373. [Install-Option]
  1374.     set STF_VITAL = ""
  1375.  
  1376.     ifstr(i) $(AddCopy) == "YES"
  1377.  
  1378.         ;
  1379.         ; Add the files to the copy list
  1380.         ;
  1381.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1382.         ;      the other INF files
  1383.         ;
  1384.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1385.  
  1386.     endif
  1387.  
  1388.     ifstr(i) $(DoCopy) == "YES"
  1389.  
  1390.        ;
  1391.        ; Copy files in the copy list
  1392.        ;
  1393.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1394.        CopyFilesInCopyList
  1395.  
  1396.     endif
  1397.  
  1398.     Exit
  1399.  
  1400. [Install-Update]
  1401.    set STF_VITAL        = ""
  1402.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1403.    ;set STF_VERSION     = "YES"
  1404.  
  1405.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1406.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1407.  
  1408.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1409.    CopyFilesInCopyList
  1410.  
  1411.    exit
  1412.  
  1413. [Install-Helpfile]
  1414.    Debug-Output "At Install-Helpfile"
  1415.    set STF_VITAL        = ""
  1416.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1417.    ;set STF_VERSION     = "YES"
  1418.     set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1419.     
  1420.    AddSectionFilesToCopyList Files-hlp $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1421.    CopyFilesInCopyList
  1422.  
  1423.    exit
  1424.  
  1425.  
  1426.  
  1427. [Install-Dll]
  1428.    set STF_VITAL        = ""
  1429.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1430.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1431.    CopyFilesInCopyList
  1432.    exit
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438. [Source Media Descriptions]
  1439.     1  = "AT1700 Driver Disk"  
  1440. ;   2  = "Windows NT Setup CD-ROM Disk "  , TAGFILE = disk1
  1441. ;   99  = "LMHOST disk", TAGFILE = lmhosts
  1442.  
  1443. [Signature]
  1444.     FileType = MICROSOFT_DRVLIB_FILE
  1445. [GetSignature]
  1446.     read-syms Signature
  1447.     return $(FileType)
  1448.  
  1449. [ProductType]
  1450. STF_PRODUCT  = Winnt
  1451. STF_PLATFORM = I386
  1452.  
  1453. [Files-Inf]
  1454. 1, oemsetup.inf,    SIZE=50000,     RENAME=$(!UG_Filename)
  1455.  
  1456. [Files-AT1700]
  1457. 1, at1700.SYS , SIZE=88888
  1458.  
  1459. [Files-Dll]
  1460. 1, at17dlg.dll,  SIZE=10000
  1461.  
  1462. [Files-hlp]
  1463. 1, AT1700.HLP, SIZE=12208
  1464.  
  1465.  
  1466. [LanguagesSupported]
  1467.     ENG
  1468.  
  1469. [OptionsTextENG]
  1470.     AT1700     = "ATI AT1720 Ethernet Adapter"
  1471.  
  1472. [FileConstantsENG]
  1473. ProCaption   = "Windows NT Setup"
  1474. ProCancel    = "Cancel"
  1475. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  1476.                "Are you sure you want to cancel copying files?"
  1477. ProCancelCap = "Network Setup Message"
  1478. ProText1     = "Copying:"
  1479. ProText2     = "To:"
  1480.  
  1481. FunctionTitle   = $(GenericAdapterName)" Card Setup"$(GenericInfVersion)
  1482.  
  1483. ProductSoftwareDescription = $(GenericDriverName)
  1484. ProductHardwareDescription = $(GenericAdapterName)
  1485. ProductHardwareAT1700Description="ATI AT1720 Driver"
  1486.  
  1487. ProductSoftwareTitle =       $(GenericDriverName)
  1488. ProductHardwareAT1700Title =       $(GenericAdapterName)
  1489.  
  1490. DialogDllName   = "at17dlg.dll"
  1491.  
  1492.  
  1493. IRQList  = ^(IRQChoices, 1)
  1494. IRQValues = ^(IRQChoices, 2)
  1495.  
  1496. IOBaseAddrList = ^(SLOTChoices, 1)
  1497. IOBaseAddrValues = ^(SLOTChoices, 2)
  1498.  
  1499. DMAChannelList = ^(DMAChannelChoices,1)
  1500. DMAChannelValues = ^(DMAChannelChoices,2)
  1501.  
  1502. LEDList = ^(LEDChoices,1)
  1503. LEDValues = ^(LEDChoices,2)
  1504.  
  1505. FullDuplexList = ^(FullDuplexChoices,1)
  1506. FullDuplexValues = ^(FullDuplexChoices,2)
  1507.  
  1508. MediaTypeList = ^(MediaTypeChoices,1)
  1509. MediaTypeValues = ^(MediaTypeChoices,2)
  1510.  
  1511. [DialogConstantsENG]
  1512. Help        = "&Help"
  1513. Exit        = "Cancel"
  1514. OK          = "&OK"
  1515. HelpContext = ""
  1516. Continue    = "Continue"
  1517. Cancel      = "&Cancel"
  1518.  
  1519. [MemoryMappedChoicesENG]
  1520. Map_1 = 1, "ON"
  1521. Map_2 = 0, "OFF"
  1522.  
  1523. [FileDependentDlgENG]
  1524.  
  1525. DlgText = "Please select values for the following fields:"
  1526.  
  1527. DlgType = "RadioCombination"
  1528. DlgTemplate = "AT1700"
  1529. Caption = $(FunctionTitle)
  1530.  
  1531.  
  1532. CBOptionsGreyed = {}
  1533. NotifyFields = {NO, NO}
  1534. HelpContext = 1
  1535.  
  1536. Combo1Label = "Card Slot:"
  1537. Combo2Label = "IRQ Number:"
  1538. Combo3Label = "DMA Number:"
  1539. ;Combo4Label = "&Full Duplex:"
  1540. Combo4Label = "Media Type:"
  1541. Combo5Label = "LED 0:"
  1542. Combo6Label = "LED 1:"
  1543. Combo7Label = "LED 2:"
  1544. Combo8Label = "LED 3:"
  1545.  
  1546. BigButton   = "More at1700 BS >>"
  1547.  
  1548. Combo1List = $(IOBaseAddrList)
  1549. Combo1Out  = $(IOBaseAddrValue)
  1550.  
  1551. Combo2List = $(IRQList)
  1552. Combo2Out  = $(IRQValue)
  1553.  
  1554. Combo3List = $(DMAChannelList)
  1555. Combo3Out  = $(DMAChannelValue)
  1556.  
  1557. ;Combo4List = $(FullDuplexList)
  1558. ;Combo4Out  = $(FullDuplexValue)
  1559.  
  1560. Combo4List = $(MediaTypeList)
  1561. Combo4Out  = $(MediaTypeValue)
  1562.  
  1563. Combo5List = $(LEDList)
  1564. Combo5Out  = $(LED0Value)
  1565.  
  1566. Combo6List = $(LEDList)
  1567. Combo6Out  = $(LED1Value)
  1568.  
  1569. Combo7List = $(LEDList)
  1570. Combo7Out  = $(LED2Value)
  1571.  
  1572. Combo8List = $(LEDList)
  1573. Combo8Out  = $(LED3Value)
  1574.  
  1575. ComboListItemsIn  = {Combo1List,Combo2List,Combo3List,Combo4List,Combo5List,Combo6List,Combo7List,Combo8List}
  1576. ComboListItemsOut = {Combo1Out,Combo2Out,Combo3Out,Combo4Out,Combo5Out,Combo6Out,Combo7Out,Combo8Out}
  1577.  
  1578. EditTextIn = ""
  1579. EditTextLim = ""
  1580.  
  1581. CheckBox1 = "&TP"
  1582.  
  1583. Group1 = "&Bus to scan"
  1584.  
  1585. Radio1 = "PCI"
  1586. Radio2 = "PNP"
  1587. Radio3 = "VESA"
  1588. Radio4 = "ISA"
  1589. Radio5 = "PCI1"
  1590. Radio6 = "PCI2"
  1591. Radio7 = "ALL"
  1592.  
  1593. [IRQChoices]
  1594. IRQ_1 = "3",3
  1595. IRQ_2 = "4",4
  1596. IRQ_3 = "5",5
  1597. IRQ_4 = "9",9
  1598. IRQ_5 = "10",10
  1599. IRQ_6 = "11",11
  1600. IRQ_7 = "12",12
  1601. IRQ_8 = "15",15
  1602.  
  1603. [IOBaseAddrChoices]
  1604. IOBase_1  = "0x240",576
  1605. IOBase_2  = "0x260",608
  1606. IOBase_3  = "0x280",640
  1607. IOBase_4  = "0x2A0",672
  1608. IOBase_5  = "0x300",768
  1609. IOBase_6  = "0x320",800
  1610. IOBase_7  = "0x340",832
  1611. IOBase_8  = "0x380",896
  1612.  
  1613. [SLOTChoices]
  1614. SLOT_1 = "1",1
  1615. SLOT_2 = "2",2
  1616. SLOT_3 = "3",3
  1617. SLOT_4 = "4",4
  1618. SLOT_5 = "5",5
  1619. SLOT_6 = "6",6
  1620. SLOT_7 = "7",7
  1621. SLOT_8 = "8",8
  1622.  
  1623. [DMAChannelChoices]
  1624. DMAChannel_1 = "3",3
  1625. DMAChannel_2 = "5",5
  1626. DMAChannel_3 = "6",6
  1627. DMAChannel_4 = "7",7
  1628.  
  1629. [LEDChoices]
  1630. LED_1 = "Default",65536
  1631. LED_2 = "0x0",0
  1632. LED_3 = "0x2",2
  1633. LED_4 = "0x4",4
  1634. LED_5 = "0x8",8
  1635. LED_6 = "0x10",16
  1636. LED_7 = "0x20",32
  1637. LED_8 = "0x30",48
  1638. LED_9 = "0x34",52
  1639. LED_10 = "0x40",64
  1640. LED_11 = "0xc0",192
  1641. LED_12 = "0x4088",16520
  1642. LED_13 = "0xb0",176
  1643. LED_14 = "0x21",129
  1644.  
  1645. [FullDuplexChoices]
  1646. FULLDUPLEX_1 = "Default",0
  1647. FULLDUPLEX_2 = "OFF",1
  1648. FULLDUPLEX_3 = "AUI",2
  1649. FULLDUPLEX_4 = "UTP",3
  1650.  
  1651. [MediaTypeChoices]
  1652. MEDIATYPE_1 = "TP",0
  1653. MEDIATYPE_2 = "Auto Select",1
  1654. ; MEDIATYPE_3 = "AUI/BNC/Fibre",2
  1655.               
  1656.